package com.jlpay.openapi.demo.openmerch.query;

import com.jlpay.open.jlpay.sdk.java.model.openmerch.query.request.MerchChannelInfoQueryRequest;
import com.jlpay.open.jlpay.sdk.java.model.openmerch.query.response.MerchChannelInfoQueryResponse;
import com.jlpay.open.jlpay.sdk.java.utils.json.JsonUtils;
import com.jlpay.openapi.demo.JlpayOpenApiService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 商户渠道信息查询
 * @author chenjunhong
 * @date 2024/4/15
 */
public class MerchChannelInfoQueryService {
    private static final Logger LOGGER = LoggerFactory.getLogger(MerchChannelInfoQueryService.class);

    public static void main(String[] args) {
        MerchChannelInfoQueryRequest merchChannelInfoQueryRequest = buildMerchChannelInfoQueryRequest();
        MerchChannelInfoQueryResponse merchChannelInfoQueryResponse = JlpayOpenApiService.openMerchService()
                .post(merchChannelInfoQueryRequest, MerchChannelInfoQueryResponse.class);
        LOGGER.info("商户渠道信息查询响应:{}", JsonUtils.toString(merchChannelInfoQueryResponse));
    }

    private static MerchChannelInfoQueryRequest buildMerchChannelInfoQueryRequest() {
        MerchChannelInfoQueryRequest merchChannelInfoQueryRequest = new MerchChannelInfoQueryRequest();
        // 商户号
        merchChannelInfoQueryRequest.setMerchNo("849584358140108");
        return merchChannelInfoQueryRequest;
    }
}
